package pers.vic.grow.netty.chapter_1_01;


import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;;

import java.net.InetSocketAddress;
import java.nio.channels.AsynchronousSocketChannel;

/**
 * @author Vic.xu
 * @description:
 * @date: 2021/9/3 0003 16:23
 */
public class MyChannelInitializer  extends ChannelInitializer {


    @Override
    protected void initChannel(Channel channel) throws Exception {
        System.out.println("链接报告开始");
        System.out.println("链接报告信息：有一客户端链接到本服务端");
        InetSocketAddress address = (InetSocketAddress) channel.localAddress();
        System.out.println("链接报告IP:" + address.getHostString());
        System.out.println("链接报告Port:" + address.getPort());
        System.out.println("链接报告完毕");
    }
}
